FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

OBMC_CONSOLE_HOST_TTY = "ttyAMA1"
OBMC_CONSOLE_HOST_TTY:phytium:df-phytium-uart1-dbg = "ttyAMA2"

SRC_URI:remove = "file://${BPN}.conf"

SRC_URI:append = " file://server.${OBMC_CONSOLE_HOST_TTY}.conf "

RDEPENDS:${PN} += "bash"

do_install:append() {
    # Remove upstream-provided configuration
    rm -rf ${D}${sysconfdir}/${BPN}

    # Install the server configuration
    install -m 0755 -d ${D}${sysconfdir}/${BPN}
    install -m 0644 ${WORKDIR}/server.${OBMC_CONSOLE_HOST_TTY}.conf ${D}${sysconfdir}/${BPN}
}

FILES:${PN} += " \
    ${systemd_system_initdir} \
    ${bindir} \
    "
